﻿using System.Windows;
using System.Windows.Controls;
using IntoStationSystem.ViewModels;

namespace IntoStationSystem.Views
{
    /// <summary>
    /// ResetPartCode.xaml 的交互逻辑
    /// </summary>
    public partial class ResetPartCodeView : UserControl
    {
        ResetPartCodeViewModel vm => Locator.Instance.ResetPartCodeVM;

        public ResetPartCodeView()
        {
            InitializeComponent();
            this.DataContext = vm;
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            vm.Load();
        }

        private void Confim_Click(object sender, RoutedEventArgs e)
        {
            vm.Reset();
            Window.GetWindow(this).Close();
        }

        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            Window.GetWindow(this).Close(); 
        }
    }
}
